package edu.suda.xsap.dto.convert;

import edu.suda.xsap.dto.CourseDto;
import edu.suda.xsap.dto.LogDto;
import edu.suda.xsap.entity.Course;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;

import java.util.List;

@Mapper(componentModel = "spring")

public interface CourseConvert {
    @Mapping(source="name", target = "name")
    @Mapping(source="duration", target = "duration")
    @Mapping(source="contains", target = "contains")
    @Mapping(source="introduce", target = "introduce")
    @Mapping(source="timesCost", target = "timesCost" )
    @Mapping(source="limitSex", target = "limitSex")
    @Mapping(source="limitAge", target = "limitAge")
    @Mapping(source="limitCounts", target = "limitCounts")
    @Mapping(source="id", target = "id")
    CourseDto toDto(Course course);

    List<CourseDto> toDtoList(List<Course> courses);
}
